package org.com.ashen.service.service.smssendlogmanage.sms.manage.dos;

import org.com.ashen.dal.dataobject.SmsReport;
import org.com.ashen.service.service.smssendlogmanage.sms.aliy.ReportResponseAliy;
import org.com.ashen.service.service.smssendlogmanage.sms.inter.http.v1.dto.response.ReportResponse;


public class SmsReportDO {
    public static SmsReport reportResponseToSmsReport(ReportResponse reportResponse){
        SmsReport smsReport = new SmsReport();
        smsReport.setSmsid(reportResponse.getSmsId());
        smsReport.setCustomsmsid(reportResponse.getCustomSmsId());
        smsReport.setState(reportResponse.getState());
        smsReport.setDecription(reportResponse.getDesc());
        smsReport.setMobile(reportResponse.getMobile());
        smsReport.setReceivetime(reportResponse.getReceiveTime());
        smsReport.setSubmittime(reportResponse.getSubmitTime());
        smsReport.setExtendecode(reportResponse.getExtendedCode());
        return smsReport;
    }

    public static SmsReport aliyReportResponseToSmsReport(ReportResponseAliy reportResponse, String smsid){
        SmsReport smsReport = new SmsReport();
        smsReport.setSmsid(smsid);
        smsReport.setCustomsmsid(reportResponse.getTemplateCode());
        smsReport.setState(reportResponse.getErrCode());
        smsReport.setDecription(reportResponse.getSendStatus()+"");
        smsReport.setMobile(reportResponse.getPhoneNum()+"");
        smsReport.setReceivetime(reportResponse.getReceiveDate());
        smsReport.setSubmittime(reportResponse.getSendDate());
        smsReport.setExtendecode(reportResponse.getTemplateCode());
        return smsReport;
    }
}
